import java.util.Random;
import java.util.Scanner;

/**
 * Created with intelliJ IDEA.
 * Description:
 * User:常亚洁
 * Date:20250913
 * Time:13:00
 */
public class test {
//求N的阶乘n*n-1

    public static int fac(int n){
        if(n==1) return 1;
        return n*fac(n-1);
    }


    public static void main(String[] args) {
        System.out.println(fac(6));

    }


    public static int add(int a,int b,int c){
        return a+b+c;
    }
    public static int add(int a,int b,short c){
        return a+c+b;}

    public static int add(int a,int b){
        return a+b;
    }
    public static double add(double a,double b){
        return a+b;
    }

    public static void main6(String[] args) {
        int x=1;
        int y=2;
        int ret=add(x,y);
        System.out.println(ret);



        double d1=1.0;
        double d2=2.0;
        double ret2=add(d1,d2);
        System.out.println(ret2);


    }

    public static void func(int year){
        year=100;
    }
    public static void main5(String[] args) {
        int year=2008;
        func(year);
        System.out.println(year);
    }

//判断闰年
public static boolean isLeapYear(int year) {
    System.out.println("方法被调用了！");
    if ((0 == year % 4 && 0 != year % 100) || 0 == year % 400) {
        return true;
    } else {
        return false;
    }
}

public static void main4(String[] args) {
    boolean ret=isLeapYear(2025);
    if(ret==true) {
        System.out.println("是闰年");
    }else {
        System.out.println("不是闰年");
    }
}



//    猜数字游戏
public static void main3(String[] args) {

    Random random=new Random();
    int randNum=random.nextInt(50);
    System.out.println(randNum);
    Scanner scan=new Scanner(System.in);
    while (true){
        System.out.println("请输入你要猜的数字：");
        int num= scan.nextInt();
        if(num<randNum){
            System.out.println("小了");
        }else if(num>randNum){
            System.out.println("大了");
        }else{
            System.out.println("等于");
            break;
        }
    }

}

    public static void main2(String[] args) {
        Scanner scan=new Scanner(System.in);

        System.out.println("读入一个读入一个字符串：");
        String str=scan.nextLine();
        System.out.println(str);
//scan.nextLine   如果读入字符串在中间或末尾
        System.out.println("读入一个整型：");
        int age=scan.nextInt();
        System.out.println(age);

        System.out.println("读入一个小数：");
        float f=scan.nextFloat();
        System.out.println(f);
    }

//    递归求1+2+3+···+n
public static int sum(int n){
    if(n==0){
        return 0;
    }
    return n+sum(n-1);
}


    public static void main1(String[] args) {
        System.out.println(sum(10));
    }
}